class CreateFlightExceptions < ActiveRecord::Migration
  def self.up
    create_table :flight_exceptions do |t|
      t.string :fromto       ,:default => '' ,:limit => 6   #航程
      t.string :fromto_desc  ,:default => '' ,:limit => 30  #城市对描述
      t.string :air_no       ,:default => '' ,:limit => 120 #航班号,可以是多个用Like判断
      t.timestamps
    end
    add_index :flight_exceptions ,:fromto ,:unique=>true
    FlightException.create(:fromto =>'taopek',:fromto_desc =>'青岛到北京',:air_no=>'CZ5195 UA4400 UA4414 FM1526')
  end

  def self.down
    drop_table :flight_exceptions
  end
end
